package cn.zc.student.feign;

import cn.zc.student.entity.Dto.StudentExercisesRespondenceDto;
import cn.zc.student.entity.StudentExercisesRespondence;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

//@Component
@FeignClient(name = "student-server",contextId = "FeignStudentExercisesRespondence")
public interface FeignStudentExercisesRespondence {

    /**
     * 调用远程接口进行保存作答记录
     * @param list
     * @return
     */
    @PostMapping("/student/create/StudentExercisesRespondence")
    boolean createStudentExercisesRespondence(@NotNull @RequestParam("list") List<StudentExercisesRespondence> list);

    /**
     * 远程调用接口，查询学生作答记录
     * @param menuId
     * @param studentId
     * @return
     */
    @GetMapping("/student/find/StudentExercisesRespondence")
    List<StudentExercisesRespondenceDto> findStudentExercisesRespondence(@NotNull @RequestParam("menuId")String menuId,@NotNull @RequestParam("studentId") String studentId);
}
